Repository navigation
test(direct_imap): always pass mark_seen=False to fetch() - #8685
Merged
Merged
Conversation
link2xt
force-pushed
the
link2xt/imap_tools-mark_seen-false
branch
2 times, most recently
from
September 13, 2026 22:27
d44d173 to
da43e24
Compare
link2xt
marked this pull request as ready for review
September 13, 2026 22:43
hpk42
reviewed
Sep 17, 2026
| # fetch latest messages before starting idle so that it only | ||
| # returns messages that arrive anew | ||
| self.direct_imap.conn.fetch("1:*") | ||
| self.direct_imap.conn.fetch("1:*", mark_seen=False) |
Contributor
There was a problem hiding this comment.
this was already, and still is a NO-OP, as fetch returns an iterator.
Probably we don't need this line or the comment at all.
Collaborator
Author
There was a problem hiding this comment.
Yes, i think this was copied from python/, there it was possibly for the case when we reused mailboxes to mark all messages that remained from previous tests as non-recent or as \Seen.
Removed it here and in python/ too.
hpk42
approved these changes
Sep 17, 2026
hpk42
left a comment
Contributor
There was a problem hiding this comment.
fine but i'd remove the commented line+docs.
This code is likely from the time when we reused mailboxes in python/ tests, it does not do anything anymore.
mark_seen=True is the default and translates to fetching BODY of the message. mark_seen=False translates to fetching BODY.PEEK that is described in IETF RFC 3501 as "An alternate form of BODY[<section>] that does not implicitly set the \Seen flag." It is unexpected unless you know this detail of IMAP protocol already, but this is not going to be fixed in imap_tools: <ikvk/imap_tools#179>
link2xt
force-pushed
the
link2xt/imap_tools-mark_seen-false
branch
from
September 17, 2026 11:52
da43e24 to
ac8e911
Compare
link2xt
enabled auto-merge (rebase)
September 17, 2026 13:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mark_seen=True is the default and translates to fetching BODY of the message. mark_seen=False translates to fetching BODY.PEEK that is described in IETF RFC 3501 as "An alternate form of
BODY[<section>]that does not implicitly set the \Seen flag."It is unexpected unless you know this detail of IMAP protocol already,
but this is not going to be fixed in imap_tools: ikvk/imap_tools#179